package com.hfzy.ihk.web.freeswitchCall.constant;

import com.hfzy.ihk.common.util.string.StringUtil;

/**
 * Created by Administrator on 2016/6/14.
 *
 * @author wws
 *
 * redis key 前缀
 */
public class RedisKey {

    //=======================key前缀===============================

    /**callHistory对象 ：<前缀+":"+sessionId:<field,value>>*/

    public static String CALL_HISTORY_RPIX = "fscall:callHistory:";

    /**************用于呼入**************start*********************************/
    /**记录最后一个通过某主显号码打给客户号码的经纪人ID等信息：
     * <newCallHistoryLastByShowNum：主显号码,<客户电话：userId，经纪人ID>>
     * <newCallHistoryLastByShowNum：主显号码,<客户电话：dataId，置业云呼记录id>>
     * <newCallHistoryLastByShowNum：主显号码,<客户电话：popupWindowId，电弹屏信息json>>
     * 改变为====>>
     * <LastCallInfo：主显号码：客户电话，<userId,经纪人ID>>
     * <LastCallInfo：主显号码：客户电话，<dataId,置业云呼记录id>>
     * <LastCallInfo：主显号码：客户电话，<popupWindowId,电弹屏信息json>>
     */
    public static String CALL_HISTORY_LAST_BY_SHOW_NUM_RPIX = "fscall:callHistoryLastByShowNum:";
    @Deprecated//
    public static String NEW_CALL_HISTORY_LAST_BY_SHOW_NUM_RPIX = "fscall:newCallHistoryLastByShowNum:";//改用LastCallInfo
    public static String LAST_CALL_INFO_RPIX = "LastCallInfo:";

    public static String LAST_CALL_INFO_USER_ID = "userId";

    public static String LAST_CALL_INFO_CITY_ID = "cityId";

    public static String LAST_CALL_INFO_DATA_ID = "dataId";

    public static String POPUP_WINDOW_ID = "popupWindowId";//保存来电弹屏信息
    /****************************end*********************************/

    /** 经纪是否占线 如果先打客户，则客户接听开始就算经纪占线 <userBuzy, <经纪人ID, true/false>> **/
    public static String USER_BUSY = "userBusy";

    public static String PUSH_TO_ES_FAILED_HISTORY = "fscall:pushToESFailedHistory";

    public static String PUSH_RECORD_URL_TO_ES_FAILED = "fscall:pushRecordUrlToESFailed:";

    /**
     * 推送数据到保利失败的set
     */
    public static String PUSH_RECORD_TO_BL_FAILED_SET = "fscall:pushRecordToBlFailedSet";

    /**
     *推送数据到Oracle失败的set
     */
    public static String PUSH_RECORD_TO_ORACLE_FAILED_SET = "fscall:pushRecordToOracleFailedSet";



    /**
     *推送数据到hbase失败的set
     */
    public static String PUSH_RECORD_TO_HBASE_FAILED_SET = "fscall:pushRecordToHbaseFailedSet";

    /*
     * 推送录音链接数据到Oracle失败的set
     */
    public static String PUSH_URL_TO_ORACLE_FAILED_SET = "fscall:pushUrlToOracleFailedSet";

    /**
     * 推送录音链接数据到Oracle的set,此set仅保存sessionId
     */
    public static String  PUSH_URL_TO_ORACLE_SET="fscall:pushUrlToOracleSet";

    /**
     * 推送录音链接数据到Es的set,此set保存sessionId和url
     */
    public static String  PUSH_URL_TO_ES_SET="fscall:pushUrlToEsSet";

    /*
     * 推送录音链接数据到hbase失败的set
     */
    public static String PUSH_URL_TO_HBASE_FAILED_SET = "fscall:pushUrlToHbaseFailedSet";


    /*
     * 推送录音链接数据到保利失败的set
     */
    public static String PUSH_URL_TO_BL_FAILED_SET = "fscall:pushUrlToBlFailedSet";

    /**
     * 用来保存白天接受到的阿里云的URL，用于晚上pao job用---下载录音到本地
     */
    public static String ALIYUN_RECORD_URL_SET = "fscall:aliyunRcordUrlSet";


    /**投诉我们的客户号码，这类号码不允许再呼出
     * Set
     * 直接设置到redis中
     * */
    public static String BAD_CUSTOMER_PHONE = "fscall:badCustomerPhone";

    /**网关
     * */
    public static String CALL_GATEWAY_MAP_KEY="fscall:callGatewayMapKey";


    public static final String ALIBABA_ASR = "fscall:alibabaAsr"; //freeswitch阿里巴巴语音分析

    public static String createFsLastCallInfo(String customerPhone){
        return StringUtil.strConnect(LAST_CALL_INFO_RPIX, customerPhone);
    }

    //taobao
    public static String DOWN_RECORD_FILE_FAIL_SET = "fscall:downRecordFileFailSet";

    public static String INTERRUPT_FAIL = "fscall:interruptFail";

    public static String TAOBAO_FILE_FAIL_SET = "fscall:taobaoFileFailSet:";

    public static String CALL_IN = "fscall:callIn:";

    public static String SWX = "swx";
    public static  String SwxTrunkStatus = "swx:trunkStatus";

    public static String SWX_CHANNEL_QUEUE = ":swxChannelQueue";

    public static String SWX_CHANNEL_MAP = ":swxChannelMap";
//    public static  String SwxTrunkStatus = "swx:trunkStatus";

    //默认城市
    public static String DEFAULT_CITY = "广州";

    //默认公司
    public static String DEFAULT_COMPANY = "HFZY";//

    public static String slotInfoKey(String sn,String trunkName ){
        return sn+":"+trunkName;

    }

    public static String IDENTIFICATION_END_STATE = "identificationEndState";

    public static String TODAY_CALL_COUT = "todayCallOut";

    /**投诉我们的客户号码，这类号码不允许再呼出
     * Set
     * 直接设置到redis中
     * */
    public static String BAD_CUSTOMER_PHONE_Map = "badCustomerPhoneMap";



    //主显号相关
    //cop线路
    public static String CUCC_SHOW_NUM_INDEX = "copShowNumIndex:";

    public static String CUCC_SHOW_NUM_LIST = "copShowNumList:";

    //阿里云线路
    public static String ALIYUN_SHOW_NUM_INDEX = "aliyunShowNumIndex:";


    public static String ALIYUN_SHOW_NUM_LIST = "aliyunShowNumList:";

}
